-
Notifications
You must be signed in to change notification settings - Fork 125
XCOMMONS-3289: Allow overwritting xwiki.properties and xwiki.cfg properties via environment variable and Java system properties #1315
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
tmortagne
wants to merge
10
commits into
master
Choose a base branch
from
feature-systemconfiguration
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6c8a0bc
to
ef44a1d
Compare
tmortagne
commented
Apr 22, 2025
* located before other sources take priority. | ||
* | ||
* @version $Id$ | ||
* @since 7.4M1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The version may look a bit strange, but it's actually a move from platform.
tmortagne
commented
Apr 22, 2025
* before other sources take priority. | ||
* | ||
* @version $Id$ | ||
* @since 2.0M1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The version may look a bit strange, but it's actually a move from platform.
ef44a1d
to
8395e0e
Compare
surli
reviewed
Apr 23, 2025
...iki-commons-configuration-api/src/main/java/org/xwiki/configuration/ConfigurationSource.java
Show resolved
Hide resolved
surli
reviewed
Apr 23, 2025
xwiki-commons-core/xwiki-commons-configuration/xwiki-commons-configuration-default/pom.xml
Outdated
Show resolved
Hide resolved
surli
reviewed
Apr 23, 2025
...lt/src/main/java/org/xwiki/configuration/internal/AbstractPropertiesConfigurationSource.java
Show resolved
Hide resolved
surli
reviewed
Apr 23, 2025
...ion-default/src/main/java/org/xwiki/configuration/internal/SystemEnvConfigurationSource.java
Outdated
Show resolved
Hide resolved
surli
reviewed
Apr 23, 2025
...ion-default/src/main/java/org/xwiki/configuration/internal/SystemEnvConfigurationSource.java
Show resolved
Hide resolved
surli
reviewed
Apr 23, 2025
...ion-default/src/main/java/org/xwiki/configuration/internal/SystemEnvConfigurationSource.java
Show resolved
Hide resolved
surli
reviewed
Apr 23, 2025
...ault/src/main/java/org/xwiki/configuration/internal/SystemPropertiesConfigurationSource.java
Show resolved
Hide resolved
surli
reviewed
Apr 23, 2025
...ault/src/main/java/org/xwiki/configuration/internal/SystemPropertiesConfigurationSource.java
Show resolved
Hide resolved
surli
reviewed
Apr 23, 2025
...configuration/xwiki-commons-configuration-default/src/main/resources/META-INF/components.txt
Show resolved
Hide resolved
surli
reviewed
Apr 23, 2025
...default/src/test/java/org/xwiki/configuration/internal/SystemEnvConfigurationSourceTest.java
Show resolved
Hide resolved
surli
reviewed
Apr 23, 2025
...ault/src/main/java/org/xwiki/configuration/internal/SystemPropertiesConfigurationSource.java
Show resolved
Hide resolved
surli
reviewed
Apr 23, 2025
...ion-default/src/main/java/org/xwiki/configuration/internal/SystemEnvConfigurationSource.java
Outdated
Show resolved
Hide resolved
ec7cca2
to
34c4bc9
Compare
…erties via environment variable and Java system properties
…erties via environment variable and Java system properties$ * add missing `@Unstable` * use a more consistent hint * add missing javadoc
…erties via environment variable and Java system properties * environment variable are actually case sensitive * add documentation
…erties via environment variable and Java system properties * add documentation
…erties via environment variable and Java system properties * improve documentation
…erties via environment variable and Java system properties * master moved to 17.4.0-SNAPSHOT
…erties via environment variable and Java system properties * won't be ready for 17.4.0RC1 * provide an abstract to help support system overwrite
34c4bc9
to
8ab0a06
Compare
…erties via environment variable and Java system properties * won't be ready for 17.4.0RC1
…erties via environment variable and Java system properties * introduce a new MapConfigurationSource helper * various minor improvements and bugfixes
manuelleduc
reviewed
May 15, 2025
...onfiguration-api/src/main/java/org/xwiki/configuration/internal/VoidConfigurationSource.java
Outdated
Show resolved
Hide resolved
manuelleduc
reviewed
May 15, 2025
...c/main/java/org/xwiki/configuration/internal/AbstractSystemOverwriteConfigurationSource.java
Outdated
Show resolved
Hide resolved
manuelleduc
reviewed
May 15, 2025
...c/main/java/org/xwiki/configuration/internal/AbstractSystemOverwriteConfigurationSource.java
Show resolved
Hide resolved
…erties via environment variable and Java system properties * codestyle * add missing javadoc
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The
xwiki-platform
side of things can be reviewed on xwiki/xwiki-platform#4069.Jira URL
https://jira.xwiki.org/browse/XCOMMONS-3289
Changes
Description
The idea is to allow overwriting any
xwiki.cfg
andxwiki.properties
values through environment variable or Java system properties. In practice, it means new System properties and environment oriented ConfigurationSource were introduces, and they should be used in any ConfigurationSource which would like to allow being overwritten by system properties and env variables.I also added new
ConfigurationSource#getKeys(String prefix)
andisEmpty(String prefix)
APIs, which are mainly helpers to directly get keys starting with a specific prefix.Clarifications
See https://forum.xwiki.org/t/add-a-generic-way-to-overwrite-some-configuration-through-environment-variables-and-java-system-properties/16711 for more details
Screenshots & Video
Executed Tests
New unit tests in
xwiki-commons-configuration-default
(92% coverage).Expected merging strategy